<template>
	<view>
		<u--image :showLoading="true" :src="goods.thumb" mode="widthFix" width="100%" height="348rpx" :lazy-load="true"></u--image>
		<view style="padding: 16rpx;">
			<view class="title">
				{{goods.title}}
			</view>
			<view class="tag">
				<view class="tag-item" v-for="(tag, tindex) in goods.goods_tag" :key="index">
					{{tag.name}}
				</view>
			</view>
			<view v-if="goods.vip_only == 0">
				<view class="price">
					<price :price="goods.sales_price"></price>
					<view class="miaosha-tag" v-if="goods.seckill == 1">
						秒杀
					</view>
				</view>
				<view class="plus-price" v-if="goods.vip == 1">
					<price textColor="#333" size="20rpx" :price="goods.vip_price"></price>
					<u-image style="margin-left: 4rpx;" width="56rpx" height="18rpx" src="https://img.koalalf.com/plus.png">
					</u-image>
				</view>
			</view>
			
			<view v-if="goods.vip_only == 1">
				<view class="price">
					<price :price="goods.sales_price"></price>
					<view class="miaosha-tag" v-if="goods.seckill == 1" style="width: 124rpx;">
						PLUS会员专属
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import price from "./price.vue"
	export default {
		components: {
			price
		},
		name: "waterfallGoodsItem",
		props: {
			goods: {
				type: Object,
				default () {
					return null;
				}
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss" scoped>
	.title {
		font-size: 24rpx;
		margin-top: 5px;
		color: #333;
		line-height: 35rpx;
		height: 75rpx;
		overflow: hidden;
		font-family: "FangSong, SimHe";
	}

	.price {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.miaosha-tag {
		border: 2rpx solid #db422c;
		color: #db422c;
		font-size: 16rpx;
		height: 28rpx;
		line-height: 28rpx;
		width: 54rpx;
		text-align: center;
		margin-left: 10rpx;
	}

	.plus-price {
		display: flex;
		flex-direction: row;
	}

	.tag {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;

		.tag-item {
			border: 2rpx solid #db422c;
			color: #db422c;
			font-size: 22rpx;
			padding: 0 6rpx;
			margin-right: 10rpx;
		}
	}
</style>
